package com.example.znbk.znbklibrary.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.example.znbk.znbklibrary.R;


public class CustomDialog {

    Context context;
    public CustomDialog(Context context){
        this.context = context;
    }

    public void show1() {

        Dialog bottomDialog = new Dialog(context, R.style.BottomDialog);

        View contentView = LayoutInflater.from(context).inflate(R.layout.dialog_content_normal, null);

        bottomDialog.setContentView(contentView);

        ViewGroup.LayoutParams layoutParams = contentView.getLayoutParams();

        layoutParams.width = context.getResources().getDisplayMetrics().widthPixels;

        contentView.setLayoutParams(layoutParams);

        bottomDialog.getWindow().setGravity(Gravity.BOTTOM);

        bottomDialog.setCanceledOnTouchOutside(true);

        bottomDialog.getWindow().setWindowAnimations(R.style.BottomDialogAnim);

        bottomDialog.show();

    }

}
